#include "CheckPointsCreator.h"
#include<fstream>
#include<math.h>


using namespace std;
CheckPointsCreator::CheckPointsCreator()
{
}

CheckPointsCreator::~CheckPointsCreator()
{
}

void CheckPointsCreator::createCPTable(ifstream* in, ofstream* out)
{
	unsigned int palavra=0;
	string dummy="";
	unsigned long long int curCheckPoint=200;
	unsigned long long int offset=0;
	while(!in->eof() && curCheckPoint <= 4294967295)
	{
		*in >> palavra;
		if(palavra >= curCheckPoint)
		{
			offset = (static_cast<unsigned long long int>(in->tellg()) - static_cast<int>(log10(palavra)) -1);
			while(palavra >=curCheckPoint)
			{	
				*out << curCheckPoint << " " << offset << endl;
				curCheckPoint+=200;
			}
		}
		getline(*in,dummy);
	}
}